FaasJS
Home
  • Guide
  • Documents
  • Starter Template
  • Changelog
  • Ecosystem

    • VS Code Plugin
    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
  • English
  • 简体中文
Home
  • Guide
  • Documents
  • Starter Template
  • Changelog
  • Ecosystem

    • VS Code Plugin
    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
  • English
  • 简体中文
🚀 FaasJS

🚀 FaasJS

An atomic application framework built for the TypeScript developer.




Features

Featherweight Development & Collaboration

  • Break down complex projects into manageable components with the atomized development model.
  • Enjoy fast iterations and seamless team collaboration.
  • Jump start development with pre-built plugins for common functionalities like HTTP and Knex.

High maintainability

  • The FaaS architecture ensures isolated cloud functions, preventing domino-effect errors.
  • Automated testing tools built-in for robust and efficient testing.

High scalability

  • Extend your application effortlessly with flexible and simple plugin mechanisms.
  • Freely scale your functions up or down based on demand.

Quick start

Start with Codespace and Template

🔨 FaasJS & Next.js Stater

🔨 Pure FaasJS Stater

Start with Command Line

# use npm
npx create-faas-app --name faasjs

# use bun
bunx create-faas-app --name faasjs

Examples

Cloud function's file

// index.func.ts
// all cloud function file should be ended with .func.ts
import { useFunc } from '@faasjs/func'
import { useHttp } from '@faasjs/http'

export const func = useFunc(function() {
  useHttp() // use http plugin

  return async function () {
    return 'Hello, world' // response content
  }
})

Unit test's file

// __tests__/index.test.ts
// all unit test file should be ended with .test.ts
import { test } from '@faasjs/test'
import Func from '../index.func'

describe('index', function () {
  it('should work', async function () {
    // wrap the cloud function
    const func = test(Func)

    // mock the request
    const { statusCode, data } = await func.JSONhandler()

    // expect the response with 200 status
    expect(statusCode).toEqual(200)
    // expect the response content is 'Hello, world'
    expect(data).toEqual('Hello, world')
  })
})

Thanks

Code contributors (in alphabetical order):

Germini, hiisea, iHeyTang, luckyporo, mingkang1993, minzojian, onichandame, Vibutnum, victoryifei, WittCsharp, zfben

Open source projects (in alphabetical order):

Biome, Jest, Knex, Node.js, React, Rollup.js, TypeScript, VuePress
An atomic application framework built for the TypeScript developer. | MIT Licensed | Copyright © 2019-2024 Zhu Feng